<!DOCTYPE html>
<script src="../../../resources/js-test.js"></script>
<style>
  .a { width: 100px; height: 100px; background-color: green; }
</style>
<script>
    var inner;
    onload = function() {
        var root = document.getElementById('root');
        var mid = document.createElement('div');
        root.appendChild(mid);

        inner = document.createElement('div');
        mid.appendChild(inner);

        inner.offsetTop;
        inner.classList.add('a');
        mid.remove();
        root.offsetTop;
        root.appendChild(mid);
        inner.offsetTop;
        inner.classList.remove('a');

        shouldBe('getComputedStyle(inner).backgroundColor', '"rgba(0, 0, 0, 0)"');
    }
</script>
<div id="root"></div>
